
<include file="Public:header"/><body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
	<div class="nav">
		<ul class="cc">
			<li class="current"><a href="/Admins/News/index/">新闻信息</a></li>
			<li ><a href="/Admins/News/add/">添加新闻</a></li>
		</ul>
	</div>
    <div class="h_a">搜索</div>
    <form method="post" action="{:U('index')}">
		<div class="search_type cc mb10">
			<div class="mb10">
			分类：
			<select name="cateid1" id="fid">
				<option value="">选择分类</option>
				<foreach name="classlist" item="vo">
					<option value="{$vo.id}" {$vo['id']== $cateid1?'selected':''}>{$vo.name}</option>
				</foreach>
			</select>
			&nbsp;&nbsp;
			<select name="cateid2" id="toclass">
				<option value="">选择分类</option>
				<foreach name="newsTwo" item="vo">
					<option value="{$vo.id}" {$vo['id']== $cateid2?'selected':''}>{$vo.name}</option>
				</foreach>
			</select>
				&nbsp;&nbsp;&nbsp;&nbsp;
				关键字：
				<input type="text" class="input length_2" name="keyword" style="width:200px;" value="{$_GET.keyword}" placeholder="请输入关键字...">
				<button class="btn">搜索</button>
		
			</div>
		</div>
	</form>
    <form name="myform" action="" method="post" class="J_ajaxForm">
    <div class="table_list">
        <table width="100%">
            <thead>
            <tr>
                <td width="4%"><label><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x"></label></td>
                <td width="8%">排序</td>
                <td width="5%">推荐</td>
                <td width="10%">所属分类</td>
                <td>新闻标题</td>
                <td width="15%">管理操作</td>
            </tr>
            </thead>
            <foreach name="newslist" item="vo">
                <tr>
                    <td><input type="checkbox" class="J_check" data-yid="J_check_y" data-xid="J_check_x" name="ids[]" value="{$vo.id}"></td>
                    <td><input name="sort[{$vo.id}]" type="text" size="3" value="{$vo.sort}" class="input"></td>
                   
                    <td>{$vo.iftj|showStatus}</td>
                    <td>{$cname[$vo["cateid1"]]}</td>
                    <td><a href="{:U("News/edit",array("id"=>$vo[id]))}">{$vo.title}</a><if condition="$vo.image neq ''"><font color="red">图</font> </if></td>
                    <td><a href="{:U('News/edit',array('id'=>$vo[id]))}">修改</a> <a class="J_ajax_del" data-msg="确定删除该信息吗?" href="{:U('News/delete',array('id'=>$vo['id']))}">删除</a></td>
                </tr>
            </foreach>
        </table>
        <div class="p10"><div class="pages"> {$Page} </div> </div>
        <div class="btn_wrap">
            <div class="btn_wrap_pd">
                <label class="mr20 sel-all"><input type="checkbox" class="J_check_all" data-direction="y" data-checklist="J_check_y">全选</label>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('News/sort')}">排序</button>
                
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('News/batch',array('do'=>'checktj'))}">推荐</button>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('News/batch',array('do'=>'canceltj'))}">取消推荐</button>
                <button class="btn J_ajax_submit_btn" type="submit" data-msg="确认删除这些信息?" data-subcheck="true" data-action="{:U('News/deleteAll')}">删除</button>
            </div>
        </div>
    </div>
</div>
</form>
</div>
<script src="__JS__/common.js"></script>

<script type="text/javascript">
$(document).ready(function(){
  $("#fid").change(function(){
		 var id = $(this).val();
		 if(id == ''){
			$("#toclass option").remove();
			$("#toclass").append("<option value=''>选择分类</option>");
		 }else{
		 	$.get("/Admins/News/ajax/id/"+id, function(result){
				if(result != 'no'){
					$("#toclass option").remove();
					
					$("#toclass").append("<option value=''>选择分类</option>"+result);
				}
			  });
		 	
		 }
  });
});
</script>

</body>
</html>